package com.zhbg.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;

@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class SysResult implements Serializable {//规范的写法
    private Integer status;//状态码 200  201
    private String msg;//服务器返回的提示信息
    private Object data;//服务器返回的业务数据

    public static SysResult faill(){

        return new SysResult(201, "业务执行失败", null);
    }

    public static SysResult success(){

        return new SysResult(200, "服务器处理成功", null);//处理成功不返回数据
    }

    public static SysResult success(Object data){//处理成功并且反馈数据

        return new SysResult(200, "服务器处理成功", data);
    }
    public static SysResult success(String msg,Object data){

        return new SysResult(200, msg, data);
    }
}